package com.xpqh.ksg.common.enums.result;

import lombok.Getter;

/**
 * 所有业务异常的枚举
 *
 * @author lizhihui
 * @date 2025.03.21
 */
@Getter
public enum BizExceptionEnum {

    /**options请求*/
    OPTIONS_REQUEST(200, "访问成功"),

    EYI(400, "非法访问！"),

    PATAMS_EMPTY(400, "参数不能为空"),

    PARAMS_ERROR(400, "参数解析失败！"),

    CODE_ERROR(400, "验证码错误！"),

    WRITE_ERROR(400, "渲染界面错误"),

    PWD_ERROR(400, "密码错误"),
    /**其他*/
    AUTH_REQUEST_ERROR(400, "账号密码错误"),

    ACCOUNT_NOT_EXISIT(400, "账户不存在"),

    ACCOUNT_NOT_EXISIT_USE_PHONE_REGISTER(400, "账户不存在，首次登录请使用手机快捷或验证码登录方式"),

    JSON_SERIALIZE_ERROR(400, "JSON SERIALIZE ERROR"),

    /**签名异常*/
    SIGN_ERROR(400, "SIGN VERIFICATION FAILED!"),
    IP_NUM(5006,"提交次数达上限"),

    /**登录过期，请重新登录*/
    TOKEN_EXPIRED(401, "登录过期，请重新登录！"),

    /**您尚未登录，请登录*/
    ACCOUNT_IS_NOT_LOGIN(401, "您尚未登录，请登录！"),

    /** token校验失败*/
    TOKEN_ERROR(401, "TOKEN VERIFICATION FAILED!"),

    ACCOUNT_LOCKED(403, "账户被禁用"),

    NO_PERMISSION(403, "您没有权限录入质保"),

    /**找不到URL*/
    API_ERROR(404, "URL走丢了"),

    REPEAT_SUBMIT(409, "请勿重复提交"),

    /** 服务器异常*/
    SERVER_ERROR(500, "服务器异常"),

    SMS_ERROR(500, "短信发送失败，请联系管理员"),

    USER_NOT_FOUND(500, "修改失败，请重试或联系客服"),
    PRODUCT_ERROR1(400,"未找到产品！"),
    PRODUCT_ERROR4(400,"产品不属于您！"),
    PRODUCT_ERROR2(400,"产品已使用!"),
    PRODUCT_ERROR3(400,"未查询到质保"),

    /**服务器维护中*/
    SERVICE_TU(503, "服务维护中");

    BizExceptionEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    // 枚举字段
    private final int code;       // 状态码
    private final String message; // 消息
}
